package com.polly.esphwevent.repository;

import com.polly.esphwevent.domain.HomeworkExt;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

/**
 * @author liqin@nd.com.cn
 * @version V1.0
 * @title: HomeworkExtDao
 * @description: TODO(用一句话描述该文件做什么)
 * @date: 2019/3/4 16:41
 */

@Mapper
@Repository
public interface HomeworkExtDao {

    @Results({
            @Result(property = "homeworkId", column = "homework_id"),
            @Result(property = "homeworkExtId", column = "homework_ext_id"),
    })

    @Select("SELECT * FROM homework_ext WHERE homework_id = #{homework_id}")
    HomeworkExt findHomeworkExtByHomeworkId(@Param("homework_id") String homeworkId);

    @Insert("INSERT INTO homework_ext(homework_ext_id,homework_id) VALUES(#{homeworkExtId}, #{homeworkId})")
    int save(@Param("homework_ext_id") String homeworkExtId, @Param("homework_id") String homeworkId);

}
